import turtle as t
import time

def drawGap():
    t.penup()
    t.fd(3)

def drawLine(draw):
    drawGap()
    t.pendown() if draw else t.penup()
    t.fd(30)
    drawGap()
    t.right(90)

def drawDigit(digit):
    drawLine(True) if digit in [2, 3, 4, 5, 6, 8, 9] else drawLine(False)
    drawLine(True) if digit in [0, 1, 3, 4, 5, 6, 7, 8, 9] else drawLine(False)
    drawLine(True) if digit in [0, 2, 3, 5, 6, 8, 9] else drawLine(False)
    drawLine(True) if digit in [0, 2, 6, 8] else drawLine(False)
    t.left(90)
    drawLine(True) if digit in [0, 4, 5, 6, 8, 9] else drawLine(False)
    drawLine(True) if digit in [0, 2, 3, 5, 6, 7, 8, 9] else drawLine(False)
    drawLine(True) if digit in [0, 1, 2, 3, 4, 7, 8, 9] else drawLine(False)

    t.left(180)
    t.penup()
    t.fd(15)

def drawDateTime(date):
    t.pencolor("red")
    for i in date:
        if i == '-':
            t.write('年', font=("Arial", 12, "normal"))
            t.pencolor("green")
            t.fd(25)
        elif i == '=':
            t.write('月', font=("Arial", 12, "normal"))
            t.pencolor("blue")
            t.fd(25)
        elif i == '+':
            t.write('日', font=("Arial", 12, "normal"))
            t.pencolor("purple")
            t.fd(25)
        elif i == '*':
            t.write('时', font=("Arial", 12, "normal"))
            t.pencolor("orange")
            t.fd(25)
        elif i == '&':
            t.write('分', font=("Arial", 12, "normal"))
            t.pencolor("brown")
            t.fd(25)
        elif i == '#':
            t.write('秒', font=("Arial", 12, "normal"))
        else:
            drawDigit(eval(i))

def main():
    t.setup(1200, 300, 200, 200)
    t.speed(0)
    t.penup()
    t.fd(-500)
    t.pensize(3)

    current_time = time.strftime('%Y-%m=%d+%H*%M&%S#', time.localtime())
    drawDateTime(current_time)

    t.hideturtle()
    t.done()

if __name__ == "__main__":
    main()